//蓝牙状态代码
const codeArr=[
    { code: 0, en: "ok", text: "操作成功" },
    { code: -1, en: "already connect", text: "已连接" },
    { code: 10000, en: "not init", text: "未初始化蓝牙适配器" },
    { code: 10001, en: "not available", text: "当前蓝牙适配器不可用" },
    { code: 10002, en: "no device", text: "没有找到指定设备" },
    { code: 10003, en: "connection fail", text: "连接失败" },
    { code: 10004, en: "no service", text: "没有找到指定服务" },
    { code: 10005, en: "no characteristic", text: "没有找到指定特征" },
    { code: 10006, en: "no connection", text: "当前连接已断开" },
    { code: 10007, en: "property not support", text: "当前特征不支持此操作" },
    { code: 10008, en: "system error", text: "其余所有系统上报的异常" },
    { code: 10009, en: "system not support", text: "Android 系统特有，系统版本低于 4.3 不支持 BLE" },
    { code: 10012, en: "operate time out", text: "连接超时" },
    { code: 10013, en: "invalid_data", text: "连接 deviceId 为空或者是格式不正确" }
]

const checkCodeState=(code) => {
    console.log(code)
    for (let index = 0; index < codeArr.length; index++) {
        const codeObj = codeArr[index];
        if(codeObj.code == code){
            console.log(codeObj)
            return codeObj;
        }
        return {code: 20000, en: "no code", text: "未获取任符合情况的状态码"}
        
    }
}
export default checkCodeState